package com.waves.message.controller;

/**
 * @author Eden
 * @date 2025/01/05 20:56
 **/

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.waves.core.web.domain.R;
import com.waves.message.dto.MessageRecordPageDTO;
import com.waves.message.service.MessageRecordService;
import com.waves.message.vo.MessageRecordPageVO;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


@RestController
@RequestMapping("/message/record")
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
@ApiModel("消息记录")
public class MessageController {

    private final MessageRecordService messageRecordService;


    @ApiOperation("获取消息记录")
    @GetMapping("/page")
    @ApiResponses(@ApiResponse(code = 200, message = "success", response = MessageRecordPageVO.class))
    public R<IPage<MessageRecordPageVO>> page(MessageRecordPageDTO messageRecordPageDTO) {
        return R.ok(messageRecordService.pageMessageRecords(messageRecordPageDTO));
    }


}
